<template>
    <header class="simple-header wrap van-hairline--bottom">
        <i class="icon-left" @click="goBack"><van-icon name="arrow-left" /></i>
        <div class="simple-header-name">{{ name }}</div>
        <i></i>
    </header>
    <div class="block"></div>
</template>

<script setup>
import {useRouter} from 'vue-router'
const props = defineProps(['name','back'])
const router = useRouter()
const goBack = ()=>{
    if(!props.back) {
        router.go(-1)
    } else {
        router.push({path:props.back})
    }
}
</script>

<style lang="less" scoped>
@import '../common/style/mixin.less';
.simple-header {
    position: fixed;
    top:0;
    left: 0;
    z-index: 9999;
    .wh(100%,44px);
    .fj();
    line-height: 44px;
    .boxSizing();
    padding: 0 10px;
    .simple-header-name {
        font-size: 14px;
    }
}
.block {
    height: 44px;
}
</style>